package gotnames.web.st;

import gotnames.dm.User;

import com.medallia.spider.EmbeddedRenderTask;
import com.medallia.spider.Task;

/**
 * Embedded task which adds the nav bar top the top of the page. Requires a
 * logged in user.
 */
public class NavbarTask extends Task implements EmbeddedRenderTask {
	
	@Output interface Values {
		V<String> EMAIL = v();
		V<Boolean> ADMIN = v();
	}
	
	void action(User user) {
		attr(Values.EMAIL, user.getEmail());
		attr(Values.ADMIN, user.isAdmin());
	}

	@Override public String getStAttribute() { return "navbar" ;}

}
